<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>我的</title>
		<meta http-equiv="expires" content="0">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<link rel="stylesheet" href="../../../css/reset.css" />
		<link rel="stylesheet" href="../../../css/mui.min.css" />
		<link rel="stylesheet" href="../../../css/iconfont.css?time=20191125" />
		<link rel="stylesheet" href="../../../css/cmms.css" />
		<link rel="stylesheet" href="../../../css/sale/index.css" />
		<link rel="stylesheet" href="../../../css/sale/mine/mine.css" />
	</head>
	<body>
		<div id="mine" class="mui-content" v-cloak>
			<nav class="mui-bar mui-bar-tab1">
				<a :class="{'mui-tab-item1':true,'mui-active':active=='index'}" data-page="index">
					<span class="mui-icon iconfont icon-home"></span>
					<span class="mui-tab-label1">首页</span>
				</a>
				<a :class="{'mui-tab-item1':true,'mui-active':active=='pre'}" data-page="bespeak">
					<span class="mui-icon iconfont icon-leijiyuyue"><span class="mui-badge">{{num=='0'?'':num}}</span></span>
					<span class="mui-tab-label1">预约</span>
				</a>
				<a :class="{'mui-tab-item1':true,'mui-active1':active=='mine'}" class="mui-tab-item" data-page="mine">
					<span class="mui-icon iconfont icon-wode">
						<!--<span class="mui-badge">2</span>-->
					</span>
					<span class="mui-tab-label1">我的</span>
				</a>
			</nav>
			<div class="wrap">
			    <header class="panel myHeader overflow">
			    	<span>
			    		<!--<i class="iconfont icon-touxiang"></i>-->
			    		<img src="../../../img/11.jpg" alt="" />
			    	</span>
			    	<span>{{infoList.name}}</span>
			    	<span class="right btn-tag" v-for="role in infoList.roles">{{role.name}}</span>
			    </header>
			    <section class="panel mySection">
			    	<ul>
			    		<!--<li class="overflow"  @tap="myMsg">
			    			<i class="iconfont icon-wodexiaoxi"></i>
			    			<span>我的消息</span>
			    			<i class="iconfont icon-fanhui right"></i>
			    		</li>-->
			    		<li class="overflow" @tap="myTeam">
			    			<i class="iconfont icon-tuandui-tianchong"></i>
			    			<span>我的团队</span>
			    			<i class="iconfont icon-fanhui right"></i>
			    		</li>
			    		<li class="overflow" @tap="myClinic">
			    			<i class="iconfont icon-icon1"></i>
			    			<span>我的客户</span>
			    			<i class="iconfont icon-fanhui right"></i>
			    		</li>
			    		<li class="overflow" @tap="toRoam">
			    			<i class="iconfont icon-tubiaozhizuomoban21"></i>
			    			<span>漫游登录</span>
			    			<i class="iconfont icon-fanhui right"></i>
			    		</li>
			    		<li class="overflow" @tap="toCoupon">
			    			<i class="iconfont icon-youhuiquan"></i>
			    			<span>我的优惠</span>
			    			<i class="iconfont icon-fanhui right"></i>
			    		</li>
						<li class="overflow noBottomBorder" @tap="toNotice">
							<i class="iconfont icon-liuchengbushu"></i>
							<span>通知配置</span>
							<i class="iconfont icon-fanhui right"></i>
						</li>
			    	</ul>
			    </section>
			    <footer class="panel mySection">
			    	<ul>
			    		<li class="overflow noBottomBorder" @tap="logout">
			    			<i class="iconfont icon-tuichu exit"></i>
			    			<span>退出登录</span>
			    		</li>
			    	</ul>
			    </footer>
			    <div id="mask" :class="{'hidden':!modelShow}"></div>
			    <div id="model" :class="{'hidden':!modelShow}">
			    	<p>退出登录</p>
			    	<p>确定要退出登录吗?</p>
			    	<p class="exitBtnBox">
			    		<span @tap="confirm" class="btn-primary">确定</span>
			    		<span @tap="cancel" class="btn-detail">取消</span>
			    	</p>
			    </div>
		    </div>
		</div>
		<script src="../../../js/mui.min.js"></script>
		<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
		<script src="../../../js/vue.js"></script>
		<script src="../../../js/cmms.js?time=333"></script>
		<script>
			new Vue({
				el:"#mine",
				data:{
					active:'mine',
					num:0,
					infoList:[],
					modelShow:'',
					romaFlag:true,//漫游登陆
					state:''
				},
				mounted(){
					this.muiInit();
					this.loadInfo();
				},
				methods:{
					loadInfo(){
						let _this = this;
						AT.muiAjax('/partner-sale/hosptal/getName','post',
						{},
						function(res){
							console.log(res);
							_this.infoList = res;
						});
					},
					myMsg(){
						location.href = "mineMsg.html"
					},
					myTeam(){
						location.href = "mineTeam.html"
					},
					myClinic(){
						location.href = "../clinic/clinic.html"
					},
					/*漫游登录设flag*/
					toRoam(){
						location.href = "../clinic/clinic.html";
					},
					toCoupon(){
						location.href = "../mine/coupon.html";
					},
					toNotice(){
						location.href = "../mine/noticeList.html";
					},
					muiInit(){
						let _this = this;
						mui(".mui-bar-tab1").on('tap','.mui-tab-item1',function(){
							let page = this.getAttribute('data-page');
							if(page=='index'){
								location.href = "../index.html";
							}
							if(page=='bespeak'){
								location.href = "../bespeak/bespeak.html";
							}
						})
					},
					/*退出弹框*/
					logout(){
						this.modelShow = true;
						
					},
					/*确认*/
					confirm(){
						let _this =this;
						_this.modelShow = false;
						AT.muiAjax('/passport/logout','post',{},function(realData){
							console.log(realData);
							localStorage.removeItem('sale_token');
//							localStorage.clear();
							_this.state = localStorage.getItem('state');
							let loginName = localStorage.getItem('loginName');
							console.log(AT.weixinUrl(_this.state,'login'))
							window.location.replace(AT.weixinUrl(_this.state,'login'));
							// window.location.replace("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+_this.state+"&redirect_uri=https%3a%2f%2flis.ulabcare.com%2fulabcare%2flogin.html&response_type=code&scope=snsapi_base&state="+_this.state+"#wechat_redirect")
//							if(loginName=='borySale'){
//								window.location.replace("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+_this.state+"&redirect_uri=https%3a%2f%2flis.ulabcare.com%2fant-dev%2flogin-bory.html&response_type=code&scope=snsapi_base&state="+_this.state+"#wechat_redirect")
//							}else if(loginName=='sale'){
//								window.location.replace("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+_this.state+"&redirect_uri=https%3a%2f%2flis.ulabcare.com%2fant-dev%2flogin.html&response_type=code&scope=snsapi_base&state="+_this.state+"#wechat_redirect")
//							}else if(loginName=='antSale'){
//								window.location.replace("https://open.weixin.qq.com/connect/oauth2/authorize?appid="+_this.state+"&redirect_uri=https%3a%2f%2flis.ulabcare.com%2fant-dev%2flogin-ant.html&response_type=code&scope=snsapi_base&state="+_this.state+"#wechat_redirect")
//							}
						});
					},
					/*取消*/
					cancel(){
						this.modelShow = false;
					}
				}
			})
		</script>
	</body>
</html>
